package final_;

/**
 * 编写一个程序，能计算圆形的面积。要求圆周率为3.14，赋值
 * 的三个方式都写一下
 */
public class FinalExercise01 {
    public static void main(String[] args) {

        Circle circle = new Circle(5.0);
        System.out.println("面积=" + circle.CalArea());
    }
}

class Circle {
    private double radius;
    private final double PT;
    //private final double PT = 3.14;

    public Circle(double radius) {
        this.radius = radius;
       // PT = 3.14;
    }

    {
        PT = 3.14;
    }
    public double CalArea(){
        return PT* radius * radius;
    }
}
